package cn.edu.shiep.aurora.gunwar.sensor;

import java.io.IOException;

import android.app.Activity;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.SoundPool;
import android.util.Log;

public class MediaPlay {

	static MediaPlay myself = null;

	private MediaPlay() {

	}

	public static MediaPlay getInstance(Activity activity) {
		if (myself == null)
			myself = new MediaPlay();
		
		return myself;
	}

	private SoundPool mSoundPool = new SoundPool(20, AudioManager.STREAM_MUSIC,
			100);
	
	private float _leftVolume, _rightVolume;
	private int b14ChangeSound;
	private int playMusicShootAGunSound;

	private float leftVolume = 1, rightVolume = 1;

	public MediaPlay(Activity activity) {
		b14ChangeSound = mSoundPool.load(activity, R.raw.shayinghuanzidan, 1);
		playMusicShootAGunSound = mSoundPool.load(activity, R.raw.shootagun, 1);
	}

	public void playB14Change(Activity activity) {
		mSoundPool.play(b14ChangeSound, leftVolume, rightVolume, 1, 0, 1);
	}

	public void playMusicShootAGun(Activity activity) {
		mSoundPool.play(playMusicShootAGunSound, leftVolume, rightVolume, 1, 0,
				1);
	}

	public void setVolume(float leftVolume, float rightVolume) {

	}
}
